﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Main.Master" CodeBehind="WSCB.aspx.cs"
    Inherits="VSM.WSCB" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function RefreshUpdatePanel() {

        };

        function disablePopup(sender, evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (charCode == 13)
                return true;

            return false;
        }
        function PopupPrint() {
            <%Session["DocumentType"] = "WB"; %> 
            //var url = "rptViewer.aspx?type=" + type + "&GeneralID=" + document.getElementById('hf_GeneralID').value;
            var url = "rptViewer.aspx?type=WB&GeneralID=" + <%= Session["ServiceID"]%>;
            Main.openCustomDialog(url, 950, 700);
            //window.open(url, '_self');
        };
    </script>
    <%--    <asp:ScriptManager ID="ScriptManagerEditItem" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>--%>
    <asp:UpdatePanel ID="editItemUpdatePanel" runat="server" UpdateMode="Conditional"
        ChildrenAsTriggers="True">
        <ContentTemplate>
            <span class="ui-priority-primary">WARRANTY SERVICE CLAIM (B)</span><br />
            <table border="0" width="100%">
                <tr>
                    <td style="width: 50%">
                        <table border="0" width="100%" style="background-color: #C9DBF2;">
                            <tr>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Date:
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txtDate" runat="server" Enabled="False" Width="35%"></asp:TextBox>
                                </td>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Dealer
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_DealerCode" runat="server" ClientIDMode="Static" Enabled="False"
                                        Width="35%"></asp:TextBox>
                                    <asp:TextBox ID="txt_DealerName" runat="server" ClientIDMode="Static" Enabled="False"
                                        Width="55%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Reg Number
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_RegistrationNum" runat="server" Width="90%" Enabled="False"></asp:TextBox>
                                </td>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Seq No
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_SeqNo" runat="server" Enabled="False" Width="35%"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Distributor
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_DistCode" runat="server" Width="35%" Enabled="False">VSM</asp:TextBox>
                                    <asp:TextBox ID="txt_DistName" runat="server" ClientIDMode="Static" Width="55%" Enabled="False">Vinastar Motors Corporation</asp:TextBox>
                                </td>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    S
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_S" runat="server" Width="35%">A</asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    ID
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_ID" runat="server" Width="12%">EB</asp:TextBox>
                                </td>
                                <td style="width: 15%" class="FormLineItemAlt">
                                    Type
                                </td>
                                <td style="width: 35%" class="FormLineItemAlt">
                                    <asp:TextBox ID="txt_Type" runat="server" Width="35%">S</asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="FormLineItemAlt" style="width: 15%">
                                    Notes:
                                </td>
                                <td class="FormLineItemAlt" colspan="3">
                                    <asp:TextBox ID="txt_Notice" runat="server" Height="53px" TextMode="MultiLine" Width="96%"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table border="0" width="100%">
                <tr>
                    <td class="style2">
                        <asp:Button ID="btn_New" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF" Height="30px"
                            Text="New" Width="90px" OnClick="btn_New_Click" />
                        <asp:Button ID="btn_Save" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                            Height="30px" OnClick="btn_Save_Click" Text="Save" Width="90px" />
                        <asp:Button ID="btn_Print" runat="server" BackColor="#1B7FC2" 
                            ForeColor="#FFFFFF" Height="30px" OnClientClick="PopupPrint();" Text="Print" 
                            Width="90px" />
                        <asp:Label ID="lb_Message" runat="server" Text="[]"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="FormLineItem">
                        <asp:Button ID="btn_LabourAdd" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                            Height="30px" Text="Add Vehicle" Width="130px" OnClick="btn_LabourAdd_Click" />
                        <asp:FileUpload ID="fu_ImportExcel" runat="server" Width="219px" 
                            Visible="False" />
                        <asp:Button ID="btn_ImportExcel" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                            Height="30px" OnClick="btn_ImportExcel_Click" Text="Import Excel" 
                            Width="150px" Visible="False" />
                    </td>
                </tr>
            </table>
            <table border="0" width="100%">
            <asp:GridView ID="grvPO" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px"
                           
                             CellSpacing="2" HeaderStyle-VerticalAlign="Middle"
                            AllowPaging="True" 
                            PageSize="20" OnRowDataBound="grvSearchResult_RowDataBound">
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text='<%# Bind("No") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="ID">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbDetID" runat="server" Text='<%# Bind("DetID") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="VIN">
                                    <ItemStyle HorizontalAlign="Center"  Width="150px"  />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_VIN" runat="server" Text='<%# Bind("VIN") %>' Width="90%"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="KD">
                                    <ItemStyle HorizontalAlign="Center" Width="50px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chk_KD" runat="server" Checked='<%# Eval("KD") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Repair Date" >
                                    <HeaderStyle VerticalAlign="Middle" Width="120px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                   <%-- <HeaderTemplate>
                                        <asp:label ID="lblHeaderETD" runat="Server" Text="ETD" />
                                        <asp:label ID="lblHeaderETDRequired" runat="server" Font-Bold="true" Text="*" ForeColor="Red" />
                                    </HeaderTemplate>--%>
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_RepairDate" Enabled="false" style="Width: 75%;" runat="server" Text='<%# Bind("RepairDate", "{0:dd/MM/yyyy}")%>' 
                                            />
                                        <asp:ImageButton ID="imgETD" runat="Server" AlternateText="Click to show calendar"
                                            ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txt_RepairDate"
                                            PopupButtonID="imgETD" Format="dd/MM/yyyy">
                                        </cc1:CalendarExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Order Number">
                                    <ItemStyle HorizontalAlign="Center" Width="120px"  />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_OrderNum" runat="server" Text='<%# Bind("OrderNum") %>' Width="90%"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Hour">
                                    <ItemStyle HorizontalAlign="Center" Width="120px"  />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_Hour" runat="server" Text='<%# Bind("Hour") %>' Width="90%"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Amount">
                                    <ItemStyle HorizontalAlign="Center" Width="120px"  />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_Amount" runat="server" Text='<%# Bind("Amount") %>' Width="90%" ></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>

                            <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                Height="27px" VerticalAlign="Bottom" />
                           <%-- <EmptyDataTemplate>
                                <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all" cellspacing="2" cellpadding="2">
                                    <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none; background-color: rgb(96, 149, 201);">
                                        <th>
                                            <span>Action</span>
                                        </th>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>
                                            <span>VIN</span>
                                        </th>
                                        <th>
                                            <span>KD</span>
                                        </th>
                                        <th>
                                            <span>Repair Date</span>
                                        </th>
                                        <th>
                                            <span>Order Number</span>
                                        </th>
                                        <th>
                                            <span>Hour</span>
                                        </th>
                                        <th>
                                            <span>Amount</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="8">
                                            <span>No Data</span>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>--%>
                        </asp:GridView>

            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
